<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class home extends MY_Controller {

    public function __construct()
    {
        parent::__construct();
    }

    //主页面
    public function index()
	{
        $_COOKIE['username'] = isset($_COOKIE['username']) ? $_COOKIE['username'] : false;
	    if($_COOKIE['username']){
           redirect('admin/admin/index');
        }else{
            $this->load->view('admin/login');
        }
    }

    public function error(){
        $this->load->view('errors/404');
    }

}
